Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New OP and API: bitwise_and/or/xor/not #33524

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Jun 11, 2021

PR types

New features

PR changes

OPs

Describe

1. 新增 按位与(bitwise_and)按位或(bitwise_or)按位异或(bitwise_xor)按位取反(bitwise_not) 4个OP及对应API
2. 新增4个Tensor API魔法函数绑定

示例:
x = paddle.to_tensor([-5, -1, 1])
y = paddle.to_tensor([4,  2, -3])

x & y ---> paddle.bitwise_and(x, y)     # 按位与
x | y ---> paddle.bitwise_or(x, y)      # 按位或
x ^ y ---> paddle.bitwise_xor(x, y)     # 按位异或
~x    ---> paddle.bitwise_not(x)        # 按位取反

中文预览: PaddlePaddle/docs#3604

图片

图片

图片

图片

英文预览:

image

image

image

image

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@zhwesky2010 zhwesky2010 merged commit ecc0537 into PaddlePaddle:develop Jun 16, 2021
@TinyQi
Copy link

TinyQi commented Sep 18, 2023

这个算子在C++的paddle_inference推理库中支持不?我目前paddle_inference2.1的好像不支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants